﻿using System;
using Monkey.Framework.Configuration;
using Monkey.Framework.Email;
using Monkey.Framework.Logging;

namespace MonkeyWarranty.Web.Common
{
    public class EmailService
    {
        public static void SendMailNewTicket(string from, string to, string cc, string bcc, string subject, string body)
        {
            if (string.IsNullOrEmpty(ApplicationSettings.EmailServiceName))
                return;
            try
            {
                EmailServiceFactory.GetEmailService().SendMail(from, to, cc, bcc, subject, body);
            }
            catch (ApplicationException)
            {
                
            }
            catch(Exception ex)
            {
                LoggingFactory.GetLogger().Log(ex.ToString());
            }
        }
    }
}